<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<script type="text/javascript" src="../js/jquery-1.11.0.js" ></script>
		<script type="text/javascript" src="../js/aikxian-common.js" ></script>
		<script type="text/javascript" src="../js/Base64.min.js" ></script>
		<script type="text/javascript" src="../js/common.js?id=0002" ></script>
		<!--<script type="text/javascript" src="../js/echarts.js" ></script>-->
		<script type="text/javascript" src="../js/rem.js" ></script>
		<script></script>
		<style>
			/*===========样式常规设置=========================================*/
			body,ul,li,dl,dt,dd,p,ol,h1,h2,h3,h4,h5,h6,form,img,table,fieldset,legend{margin:0; padding:0;}
			ul,li,ol{list-style:none;}
			img,fieldset{border:0; }
			/*img{display:block;}*/
			a{text-decoration:none;}
			h1,h2,h3,h4,h5,h6{font-weight:100;}
			body{font-family: "Microsoft Yahei","微软雅黑","Tahoma","Helvetica","STHeiti";}
			input,a,select{outline:none;}
			i{font-style:normal;}
			body{
				font-size: 0.3rem;	
				background:#efefef;
				
			}
			/*字体*/
			.bigSize{
				font-size: 20px;
			}
			.normalSize{
				font-size: 0.32rem;
			}
			.littleSize{
				font-size: 0.28rem;
			}
			.samllSize{
				font-size: 0.24rem;
			}
			img,div,input,ul,li{
				-webkit-tap-highlight-color: transparent;
				-webkit-appearance: none;
			}
			/*===========样式常规设置end=======================================*/
			header{
				width:100%;
				height:2rem;
				background: cornflowerblue;
				z-index: 99;
				position: fixed;
				top:0;
				left:0;
				background:url(../img/bgHead.png) no-repeat left top;
				background-size: cover;
			}
			.updateTime{
				line-height: 0.5rem;
				color:#666;
				float: right;
				margin-right: 0.5rem;
				font-size: 0.24rem;
			}
			.title{
				width:74%;
				padding-left:0.1rem;
				box-sizing: border-box;
				height:1rem;
				overflow: hidden;
				float:right;
				margin-top:0.15rem;
				margin-right: 0.3rem;
				background: url(../img/kuang.png) no-repeat left top;
				background-size:cover;
				color:#000;
				font-size:0.32rem;
				/*padding-right: 0.5rem;*/
				/*box-sizing: border-box;*/
			}
			
			.container{
				width:100%;
				/*height:auto;*/
				margin-top:1rem;
				border-top:1px solid #C0C0C0;
				padding:0 0.4rem 1rem;
				box-sizing: border-box;
				background:#fff;
			}
			.list{
				width:100%;
				border:1px solid #ccc;
				border-bottom: none;
				margin-top: 1rem;
				border-radius: 4px;
				-webkit-border-radius: 5px;
				overflow: hidden;
			}
			
			li{
				width:100%;
				height:0.8rem;
				line-height:0.8rem;
				border-bottom: 1px solid #CCCCCC;
			}
			li:nth-child(odd){
				background:#EFEFEF;
			}
			li.head{
				background:salmon;
			}
			li span{
				display: block;
				width:50%;
				height:100%;
				float:left;
				text-align: center;
				
			}
			.loading{
			width:100%;
			height:100%;
			position: fixed;
			z-index: 1024;
			background:#fff;
			top:0;
			left:0;
		}
		.loadImg{
			width:30px;
			height:30px;
			position: absolute;
			top:50%;
			left:50%;
			margin-top:-15px;
			margin-left:-15px;
			
			
		}
		.loadImg{
			width:30px;
			height:30px;
			position: absolute;
			top:50%;
			left:50%;
			margin-top:-15px;
			margin-left:-15px;
			
		}
		
		.nodata_img{
			display:block;
			width:26%;
			margin:2rem auto 0;
		}
		.nodata_p{
			width:100%;
			text-align: center;
			line-height: 0.5rem;
			color:#666;
			
		}
			</style>
			
		<title></title>
	</head>
	<body>
		<div class="loading">
      	  <img src="../img/jiazai.gif" class="loadImg"/> 
        </div>
		<span id="ruler" class='littleSize'></span>
		<header>
			<span class='updateTime samllSize'>更新时间：<i>2017/03/04</i></span>
			<div class="title littleSize" id='title'>大唐财富诚现金管理1号投资基金(2017年)1号投资</div>
		</header>
		<div class="container">
			<ul class='list'>
				<li class='head'><span class='left'>时间</span><span class='right'>万份收益</span></li>
				
			</ul>
		</div>
		<script>
		window.onload=function(){
			$(".loading").fadeOut();
		//最外层	
			dataAjax();
			function dataAjax(){
				var orderStatus=$.getUrlParam("orderStatus");
				var prodName=$.getUrlParam("prodName");
				var queryTime=$.getUrlParam("queryTime");
				var queryFlag=$.getUrlParam("queryFlag");
				var proCode=$.getUrlParam("proCode");
				//var str='{"language":"zh_CN","proCode":"201503160107","queryFlag":"1","queryFlag":"3"}';
				var str='{"language":"zh_CN","proCode":"'+proCode+'","queryFlag":"'+queryFlag+'","queryTime":"'+queryTime+'"}';
				str = Base64.encode(str);
				if(queryFlag==0){
					$(".right").html("七日年化收益率(%)");
				}else if(queryFlag==1){
					$(".right").html("每万份收益");
				}
				jQuery(function(){
						jQuery.ajax({
							url:yunying_require,
							type:"post",
							dataType:"text",
							data:{commonURL:yunying_require,'param':str,'opName':'private_profit_list',"osFlag":'5'},
							async:false,
							success:function(serverinfo){
								console.log(serverinfo);
								var Data=Base64.decode(serverinfo);
								Data=JSON.parse(Data);
								console.log(Data);
								if(Data.updateTime){
									$(".updateTime").html("更新时间"+Data.updateTime);
								}
								
								
//								console.log(Data.statusList);
								if(Data.result&&Data.result.length>0){
									var result=Data.result;
									
//									console.log(Data.result[0].value);
									for(var i=0;i<result.length;i++){
										var $li=$('<li><span>'+result[i].value[0]+'</span><span>'+result[i].value[1]+'</span></li>');
										$('ul').append($li);
									}
								}else{
									$("ul").hide();
									var $img=$('<img src="../img/nodata.png" class="nodata_img"/>');
									var $p=$('<p class="nodata_p normalSize">暂无数据</p >');
									$(".container").append($img);
									$(".container").append($p);
									//当没有数据时的处理方案；
											var newUlHeight=window.screen.height-$('header').height()+30;
											$('.nodata_img').css('margin-top',newUlHeight/4);
											$(".container").height(newUlHeight);
											$('body').css('overflow','hidden');
									//	
								}
								
							},
							error:function(){
								
							}
						})
				})
		
		}
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			//计算标题长度
				var Text = $("#title").html();  
				String.prototype.visualLength = function()  
				{  
			        var ruler = $("#ruler"); 
//					alert(this);
					ruler.text(Text);
			        return ruler[0].offsetWidth;  
				} 				
				
				var len = Text.visualLength();
//				alert('len='+len);
				var kuangWidth=$("#title").width();
				var kuangHeight=$("#title").height();
//				alert('kuangWidth='+kuangWidth);
				//alert('kuangHeight='+kuangHeight);
				if(len<kuangWidth){
					$("#title").css('line-height',kuangHeight+'px');
				}else{
					var lineHeight=$("#ruler")[0].offsetHeight+2;
//					alert(lineHeight)
					$("#title").css('line-height',lineHeight+'px');
				}
		}
		</script>
	</body>
</html>
